package com.hzqy.service.industry;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.hzqy.persistence.dao.industry.IndustryDao;
import com.hzqy.service.core.GenericServiceBean;
import com.hzqy.web.vo.industry.ZjDataOpenInterfaceDatasVo;
import com.hzqy.web.vo.industry.ZjZheJiangServiceVo;
import com.hzqy.web.vo.system.SysAreaVo;

@Service
public class IndustryServiceBean  extends GenericServiceBean<ZjDataOpenInterfaceDatasVo, IndustryDao, Integer>{
	protected final Logger LOG = LoggerFactory.getLogger(getClass());
	private static final long serialVersionUID = 1L;
	@Resource
	private IndustryDao industryDao;
	@Override
	public IndustryDao getEntityDao() {
		return industryDao;
	}
	public Map<String,Object> selectZjDataOpenInterfaceDatasList(ZjDataOpenInterfaceDatasVo zjDataOpenInterfaceDatasVo, int curPage,
			int pageSize) {
		Map<String,Object> map = new HashMap<String, Object>();
		
		Integer rowCount = industryDao.selectZjDataOpenInterfaceDatasCount(zjDataOpenInterfaceDatasVo);
		map.put("total", rowCount);
		if(rowCount > 0 && curPage > 0 && pageSize > 0) {
			map.put("firstResult", (curPage-1)*pageSize);
			map.put("maxResults", pageSize);
			map.put("f_zdoid_interface_id", zjDataOpenInterfaceDatasVo.getF_zdoid_interface_id());
			List<ZjDataOpenInterfaceDatasVo> results = industryDao.selectZjDataOpenInterfaceDatasList(map);
			map.put("rows", results);
		} else {
			map.put("rows", new ArrayList<ZjDataOpenInterfaceDatasVo>());
		}
		return map;
	}
	public Map<String, Object> selectZjZheJiangServiceList(ZjZheJiangServiceVo zjZheJiangServiceVo, int curPage, int pageSize) {
		Map<String,Object> map = new HashMap<String, Object>();
		Integer rowCount = industryDao.selectZjZheJiangServiceListCount(zjZheJiangServiceVo);
		map.put("total", rowCount);
		if(rowCount > 0 && curPage > 0 && pageSize > 0) {
			map.put("firstResult", (curPage-1)*pageSize);
			map.put("maxResults", pageSize);
			map.put("f_zjbs_status", zjZheJiangServiceVo.getF_zjbs_status());
			map.put("f_zjbs_name", zjZheJiangServiceVo.getF_zjbs_name());
			map.put("f_zjbs_areaId", zjZheJiangServiceVo.getF_zjbs_areaId());
			map.put("f_zjbs_id", zjZheJiangServiceVo.getF_zjbs_id());
			List<ZjDataOpenInterfaceDatasVo> results = industryDao.selectZjZheJiangServiceList(map);
			map.put("rows", results);
		} else {
			map.put("rows", new ArrayList<ZjDataOpenInterfaceDatasVo>());
		}
		return map;
	}
	public Map<String, Object> selectSysAreaList(SysAreaVo sysAreaVo, int curPage, int pageSize) {
		Map<String,Object> map = new HashMap<String, Object>();
		Integer rowCount = industryDao.selectSysAreaListCount(sysAreaVo);
		map.put("total", rowCount);
		if(rowCount > 0 && curPage > 0 && pageSize > 0) {
			map.put("firstResult", (curPage-1)*pageSize);
			map.put("maxResults", pageSize);
			map.put("f_sa_name", sysAreaVo.getF_sa_name());
			map.put("f_sa_type", sysAreaVo.getF_sa_type());
			map.put("f_sa_parentId", sysAreaVo.getF_sa_parentId());
			List<SysAreaVo> results = industryDao.selectSysAreaList(map);
			map.put("rows", results);
		} else {
			map.put("rows", new ArrayList<ZjDataOpenInterfaceDatasVo>());
		}
		return map;
	}

}
